
clear all
set more off



cd "ADD HERE FOLDER IN WHICH DATA IS CONTAINED"

use "input\final_individual_rep.dta", clear


reghdfe firm_inventor_1930 depsusp33_med   if sample_intensive==1, a(state_id_match) cluster(county_id_match)
	est store t1c1
	estadd local state_fe "Y"
	estadd local pat_post "Y"
	estadd local ind_pat_pre "Y"
	estadd local count_cntrls "N"
	estadd local ind_cntrls "N"
reghdfe firm_inventor_1930  depsusp33_med   l_pop20  if sample_intensive==1, a(state_id_match) cluster(county_id_match)
	est store t1c2
	estadd local state_fe "Y"
	estadd local pat_post "Y"
	estadd local ind_pat_pre "Y"
	estadd local count_cntrls "Y" 
	estadd local ind_cntrls "N"
reghdfe firm_inventor_1930 depsusp33_med   l_pop20 own_home l_age female entr if sample_intensive==1, a(state_id_match) cluster(county_id_match)
	est store t1c3
	estadd local state_fe "Y"
	estadd local pat_post "Y"
	estadd local ind_pat_pre "Y"
	estadd local count_cntrls "Y"
	estadd local ind_cntrls "Y"

esttab  t1c1 t1c2 t1c3  using "output\table10.tex", replace label f booktabs style(tex) alignment (c) nofloat ///
	noobs depvars nomtitles ///
	hlinechar(`=char(151)') ///
	mgroups("Patent in Firm in 1930s", pattern(0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})  ) ///
	varwidth(30) modelwidth (12) collabels(none)  legend  ///
	cells(b(star fmt(%12.3f))  se(par fmt(%12.3f)))  /// 
	keep(*depsusp33*) ///
	stats(state_fe pat_post ind_pat_pre count_cntrls ind_cntrls r2_a N , fmt(0 0 0 0 0 %9.3fc %9.0fc ) labels("State FE" "Patent Post" "Pre Ind Pat" "County Controls" "Ind. Controls"  "Adj R-Sq" "Obs") ) ///
	star(* 0.10 ** 0.05 *** 0.01)  
	
estimates clear
